package com.example.androidstudy.ch09;

import com.example.androidstudy.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SubMenu;
import android.widget.TextView;

public class OptionMenu extends Activity {
	TextView tv;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		tv = new TextView(this);
		tv.setText("메뉴 키를 누르세요");
		setContentView(tv);
	
	
	}
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		
		MenuItem item = menu.add(0,1,0,"짜장");
		item.setIcon(R.drawable.ic_launcher);
		
		menu.add(0, 2, 0, "짬뽕").setIcon(R.drawable.ic_launcher);
		
		SubMenu etc = menu.addSubMenu("기타");
		etc.add(0, 3, 0, "우동").setIcon(R.drawable.ic_launcher);
		etc.add(0, 4, 0, "만두").setIcon(R.drawable.ic_launcher);
		
		return true;
	}
	
	
	
}
